
//
//  BDHomeCellForwardingView.m
//  BadBoy
//
//  Created by wen on 2017/3/13.
//  Copyright © 2017年 com.8xiong. All rights reserved.
//

#import "BDHomeCellForwardingView.h"

@interface BDHomeCellForwardingView ()

@property (nonatomic, strong) UILabel *te_label;



@end

@implementation BDHomeCellForwardingView

- (void)configeWithModel:(id)model{
    BDHomeModel *homeModel= model;
    self.homeModel = homeModel.repost;
    NSString *str = [NSString stringWithFormat:@"@%@：%@", self.homeModel.nickname, self.homeModel.post];
    self.te_label.text = str;
    
    [self.imageViews configeWithModel:self.homeModel];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.te_label.numberOfLines = 0;
    self.te_label.font = [UIFont systemFontOfSize:15];
    self.te_label.textColor = [UIColor colorWithHexString:@"#4c4c4c"];
    self.te_label.width = self.width - 20;
    self.te_label.height = [self.te_label.text heightWithFont:self.te_label.font width:self.width - 20];
    self.te_label.top = 10;
    self.te_label.left = 10;
    
    self.imageViews.width = self.width;
    self.imageViews.height = self.homeModel.imageHeight;
    self.imageViews.top = self.te_label.bottom + 10;
    
    self.backgroundColor = [UIColor colorWithRed:247/255.0 green:247/255.0 blue:247/255.0 alpha:1.0f];
}

- (UILabel *)te_label{
    if (!_te_label) {
        self.te_label= [[UILabel alloc] init];
        [self addSubview:_te_label];
    }
    return _te_label;
}

- (BDHomeCellImageview *)imageViews{
    if (!_imageViews) {
        self.imageViews = [[BDHomeCellImageview alloc] init];
        [self addSubview:_imageViews];
    }
    return _imageViews;
}

@end
